#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
int main()
{
	FILE* pf = fopen("data.txt", "r");
	if (pf == NULL)
	{
		perror("fopen");
		return 1;
	}

	FILE* str = fopen("data_copy.txt", "w");
	if (str == NULL)
	{
		perror("fopen");
		return 1;
	}

	int c = 0;
	while ((c = fgetc(pf)) != EOF)
	{
		fputc(c, str);
	}
	fclose(pf);
	pf = NULL;
	fclose(str);
	str = NULL;
	return 0;
}